<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::any('/', function () {
    return time();
});
use Illuminate\Http\Request;

Route::post('/tokens/create', function (Request $request) {
    $token = $request->user()->createToken($request->token_name);

    return ['token' => $token->plainTextToken];
});
Route::post('admin/create', [\App\Http\Controllers\Admin\SystemUser::class,"create"]);
Route::middleware('auth:sanctum')->group(function () {
    Route::get('test2', 'TestController@index2');
    //首页统计
    Route::get('index', 'IndexController@index');
    //修改密码
    Route::post('update_password', 'AdminController@update_password');
    Route::post('user/list', 'AdminController@list');
    Route::post('create', 'AdminController@create');
    Route::post('user/edit', 'AdminController@edit');
    Route::post('user/role', 'AdminController@role');
    Route::post('user/get_role', 'AdminController@getRole');
});
